<template>
  <div class="user-wrap">
    <div class="top-bar">
      <h1>个人中心</h1>
    </div>

    <div class="common-box">
      <div class="common-box-member m-line-parallel arrow-right-icon user-info">
        <img
          src="https://static.smartisanos.cn/mobilenew/img/head.4b81d150.png"
          alt=""
        />
        <div v-if="userInfo" @click="tiaozuan">
          <span>{{ userInfo.phone }}</span>
        </div>
        <div v-else @click="tiao">
          <span>登录 / 注册 </span>
        </div>
      </div>
      <ul class="common-box-member m-parallel">
        <li class="m-line-vertical icon icon-order">
          <span> 全部订单</span>
        </li>
        <li class="m-line-vertical icon icon-unpay">
          <span>待付款</span>
        </li>
        <li class="m-line-vertical icon icon-undone">
          <span> 待收货</span>
        </li>
        <li class="m-line-vertical icon icon-comment">
          <span> 待评价 </span>
        </li>
        <li class="m-line-vertical icon icon-aftersale">
          <span> 售后</span>
        </li>
      </ul>
    </div>
    <ul class="common-box items">
      <li
        class="common-box-member arrow-right-icon m-line-parallel"
        @click="address()"
      >
        地址管理
      </li>
      <li class="common-box-member arrow-right-icon m-line-parallel">
        我的优惠券
      </li>
      <li class="common-box-member arrow-right-icon m-line-parallel">
        优先购买码
      </li>
    </ul>

    <ul class="common-box items">
      <li
        class="common-box-member arrow-right-icon m-line-parallel"
        @click="like"
      >
        我的收藏
      </li>
      <li
        class="common-box-member arrow-right-icon m-line-parallel"
        @click="collection"
      >
        我的点赞
      </li>
    </ul>
    <ul class="common-box items">
      <li class="common-box-member arrow-right-icon m-line-parallel">
        意外碎屏保修服务
      </li>
      <li class="common-box-member arrow-right-icon m-line-parallel">
        延长保修服务
      </li>
      <li class="common-box-member arrow-right-icon m-line-parallel">
        协议政策
      </li>
      <li class="common-box-member arrow-right-icon m-line-parallel">
        资质证明
      </li>
      <li class="common-box-member arrow-right-icon m-line-parallel">
        活动说明
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    tiao() {
      this.$router.push({ name: "logins" });
    },
    tiaozuan() {
      this.$router.push({ name: "account" });
    },
    like() {
      this.$router.push({ name: "like" });
    },
    collection() {
      this.$router.push({ name: "collection" });
    },
    address() {
      this.$router.push({ name: "address" });
    },
  },
};
</script>



<style lang="scss" scoped>
.user-wrap {
  font-size: 17px;
  padding: 58.33px 12.5px 65px;
  background: #f5f5f5
    url(https://static.smartisanos.cn/mobilenew/img/bg.205d0820.png) repeat 50%;
  background-size: 100%;
  box-sizing: border-box;
  min-height: 100vh;
  // font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.8);
  .top-bar {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    height: 50px;
    position: fixed;
    width: 100%;
    max-width: 480px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 199;
    h1 {
      color: rgba(0, 0, 0, 0.6);
      text-align: center;
      line-height: 50px;
      font-weight: 700;
      font-size: 19px;
    }
  }
  .common-box {
    margin-bottom: 13.5px;
    position: relative;
    overflow: hidden;
    background: #fff;
    margin-top: 5.2px;
    border-radius: 8px;
    box-shadow: 0 5px 13px rgb(0 0 0 / 5%);
    .user-info {
      padding: 16.667px 18.75px;
      font-weight: 700;
      position: relative;
      display: flex;
      -webkit-box-align: center;
      align-items: center;
      img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        vertical-align: middle;
      }
      span {
        padding-left: 18.7px;
        font-size: 18px;
      }
    }
    .m-parallel {
      padding: 0;
      line-height: 1rem;
      position: relative;
      display: flex;
      align-items: center;
      li {
        -webkit-box-flex: 0;
        flex: 0 0 20%;
        text-align: center;
        font-size: 11px;
        padding: 9.37px 0;
        position: relative;
      }
      span {
        color: rgba(0, 0, 0, 0.4);
        font-weight: 700;
        line-height: 13px;
        margin-top: 4px;
        display: block;
      }
      .icon-order:before {
        background: url()
          no-repeat 50%;
        background-size: 16px;
      }
      .icon-unpay::before {
        background: url()
          no-repeat 50%;
        background-size: 16px;
      }
      .icon-undone::before {
        background: url()
          no-repeat 50%;
        background-size: 16px;
      }
      .icon-comment::before {
        background: url()
          no-repeat 50%;
        background-size: 16px;
      }
      .icon-aftersale::before {
        background: url()
          no-repeat 50%;
        background-size: 16px;
      }
      .m-line-vertical:before {
        width: 25px;
        height: 25px;
        content: " ";
        display: block;
        margin: 0 auto;
      }
      .m-line-vertical:after {
        position: absolute;
        top: 0;
        right: 0;
        content: "";
        width: 1px;
        height: 100%;
        background: rgba(0, 0, 0, 0.06);
        transform: matrix(1, 0, 0, -1, 0, 0);
      }
    }
  }
  .arrow-right-icon::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 10px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: url()
      no-repeat 50%;
    background-size: contain;
  }
  .m-line-parallel:before {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    content: "";
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    transform: scaleY(0.67);
  }
  .common-box-member {
    padding: 20px;
    position: relative;
    display: flex;
    align-items: center;
  }
}
</style>